package com.alibaba.sample.kantiezi.web.user.module.action;

import cn.kantie.web.artical.facade.ArticalSeviceFacade;

import com.alibaba.biz.command.dispatcher.CommandDispatcher;
import com.alibaba.service.form.FormService;
import com.alibaba.service.template.TemplateContext;
import com.alibaba.service.uribroker.URIBrokerService;
import com.alibaba.turbine.module.action.TemplateAction;
import com.alibaba.turbine.service.rundata.RunData;
import com.alibaba.webx.WebxException;

public abstract class ArticalUrlAction extends TemplateAction {
    ArticalSeviceFacade articalServiceFacade;
    
    protected abstract CommandDispatcher getCommandDispatcher();

    protected abstract FormService getFormService();

    protected abstract URIBrokerService getURIBrokerService();

    public void doLogin(RunData rundata, TemplateContext context)
            throws WebxException {           
            String memo =  rundata.getParameters().getString("memo");
            String status =  rundata.getParameters().getString("status");
            String url =  rundata.getParameters().getString("url");
            String articalId =  rundata.getParameters().getString("articalId");
            int aid = new Integer(articalId);
            articalServiceFacade.addNewArtical(aid, url, status, memo);       
        }

    /**
     * @param articalServiceFacade The articalServiceFacade to set.
     */
    public void setArticalServiceFacade(ArticalSeviceFacade articalServiceFacade) {
        this.articalServiceFacade = articalServiceFacade;
    }
    } 
